package org.testis.testdriver;

import org.testis.testdriver.AtofEnumaration.ExecutionInterventionType;

/**
 * Abstract Visitee class that is used to execute the Visitor TestPart class.
 * 
 * @author barisergun
 */
public abstract class ExecutionInterface {

    protected TestPart mTestPart;

    public ExecutionInterface() {
        ExecutionInterventionStateSingleton.createInstance();
    }

    public Integer getCurrentRunningTestPlanId() {
        return ((StepContainer)mTestPart).getCurrentRunningTestPlan();
    }

    /**
     * This method is used to execute the Visitor class run method. 
     */
    public abstract void execute() throws InterruptedException;

    /**
     * This method is used to get the Visitor TestPart object. 
     * 
     * @return TestPart TestPart object returned
     */
    public TestPart getTestPart() {
        return mTestPart;
    }

    /**
     * This method is used to set the Visitor TestPart object. 
     * 
     * @param val TestPart object taht will be set.
     */
    public void setTestPart(TestPart val) {
        this.mTestPart = val;
    }

    /**
     * This method is used to abort/pause or resume state.
     *
     * @param val TestPart object taht will be set.
     */
    public void setExecutionIntervention(ExecutionInterventionType val) {
        ExecutionInterventionStateSingleton.getInstance().
                setInterventionState(val);
    }
}

